package cn.lu.joke.adapter.decoration;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import cn.lu.joke.util.LogUtils;

public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
    private int space;

    public SpaceItemDecoration(int space) {
        this.space = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        outRect.bottom = space;
        LogUtils.e(parent.getChildLayoutPosition(view)+"------------>" + state.getItemCount());
        if (parent.getChildLayoutPosition(view) % 5 == 0) {
            //outRect.left = 0;
        }
    }
}
